var url = domainUrl +  '/serve/gainsharing';
var  delId = '';
$(function () {
    findAllSacer();
});
var pageNp = false;
function  findAllSacer(currentPage){
    var urlFindAll = url + "/findAll";
    var getData ={
        startDate:$("#startDate").val(),
        endDate:$("#endDate").val(),
        currentPage:currentPage,
        limit:10
    } ;
    getAjax(urlFindAll,false,getData,function (data) {
        pageList = Math.ceil(data.total / 9);
        var num  = data.result.length;
        var d;
        var html='';
        for(var i =0 ; i < num ; i++) {
            d = data.result[i];
            html+='  <tr> <td >'+d.closeAnAccountStr+'</td> <td >'+d.terraceGainsharing+'</td> <td >'+d.organizationGainsharing+'</td> <td >'+d.gainsharing+'</td> <td>'+d.moneyType+'</td> </tr>';
        }
        $("#gainsharing").html(html);
        if (pageNp == false) {
            pageNp = true;
            $(".tcdPageCode").createPage({
                pageCount: pageList,
                current: currentPage,
                backFn: function (p) {

                    findAllSacer(p)
                }
            });
        }
    })
}